This invention relates to a method and apparatus for encoding image data. The invention is particularly concerned with an encoding technique for image compression, for reducing the amount of memory required to store the image data, or the time required to transmit the data.
One method of compressing image data is described by C. Chamzas and D. L. Duttweiler, "Progressive encoding of facsimile images using edge decomposition (PED)", Proc. GLOBECOM 1988 pages 1011-1015, 1988. In this method, a high resolution image is convert-ed into a low resolution image, such that each pixel (picture element) of the low resolution image corresponds to a group of the pixels in the original image (this group being referred to as a superoixel). At the same time, a supplementary file is produced, containing the information required to reconstruct the high resolution image from the low resolution image.
A characteristic of this compression technique is that it can be applied repeatedly to the image data, so as to produce progressively higher levels of compression. In other words, the compression technique is applied first to the original image data, to produce a low resolution image; the compression is then applied to this low resolution image to produce a still lower resolution image; and so on until the desired degree of compression is achieved. Decoding is achieved by reversing the process.
This progressive encoding characteristic has the advantage that, when a user requires to view the image, it is not necessary for the image to be fully decompressed before it can be viewed. The stored low resolution image can be displayed immediately, with progressively higher resolution images being displayed as the decoding proceeds, until either the maximum resolution for the display is achieved, or else the user decides that the image is not required.
The method described in the above-mentioned paper for producing a low resolution image from a high resolution image is as follows.
For each pixel S in the low resolution image, two adjacent pixel A and P are examined. If A=P, it is predicted that S will be the same colour (black or white) as both A and P. The corresponding superpixel in the high resolution image is then examined to deter,-.line whether this prediction is correct. If the prediction is correct, i.e. all the pixels in the superpixel are of the predicted colour) then S is set to the predicted colour. If the prediction is not correct, S is set to the opposite colour, and the actual bit pattern of the superpixel corresponding to S is stored in the supplementary file.
If, on the other hand, A is not equal to P, no prediction is made for S, and the actual bit pattern of the corresponding superpixel is stored in the supplementary file. S may be set to either colour in this case.
Reconstruction of the original high-resolution image can be achieved simply by reversing the above procedure.
It has been found that a problem with the above compression technique is that it tends to lead to instability in the compressed image. This can occur if a straight horizontal or vertical edge in the image runs through the middle of a row or column of superpixels, and takes the form of an oscillation between black and white pixels along that edge.
The object of the present invention is to overcome this problem.